/**
 * Created by zby on 2018/3/25.
 */
public class Pillar2 {
    Geometry bottom;
    double height;

    Pillar2(Geometry bottom, double height) {
        this.bottom = bottom;
        this.height = height;
    }

    public double getVolum() {
        if (bottom == null) {
            System.out.println("没有底，无法计算体积");
            return -1;
        }
        return bottom.getArea() * height;
    }
}
